#ifndef __DEBUG_H
#define __DEBUG_H

#ifdef __cplusplus
 extern "C" {
#endif

#include <stdio.h>
#include "System.h"

#define LOG_EMG_LEVEL       0

#define LOG_COMMON_LEVEL    (LOG_EMG_LEVEL + 1)
#define LOG_ERR_LEVEL       (LOG_COMMON_LEVEL + 1)
#define LOG_WARN_LEVEL      (LOG_ERR_LEVEL + 1)
#define LOG_INFO_LEVEL      (LOG_WARN_LEVEL + 1)
#define LOG_DEBUG_LEVEL     (LOG_INFO_LEVEL + 1)

#if(VERSION_TYPE == DEBUG_VERSION)
	#define PRINT_LEVEL         LOG_DEBUG_LEVEL
#else
	#define PRINT_LEVEL         LOG_INFO_LEVEL
#endif
	 
    #define DEBUG_MSG(fmt, args...)    	App_Printf(LOG_DEBUG_LEVEL,fmt, ##args)
	#define ERR_MSG(fmt, args...)    	App_Printf(LOG_ERR_LEVEL,fmt, ##args)
	#define INFO_MSG(fmt, args...)    	App_Printf(LOG_INFO_LEVEL,fmt, ##args)


	void Debug_Init(void);
	

	int App_Printf(uint8_t _level,const char * _format, ... );
	
#ifdef __cplusplus
}
#endif
#endif
